<template>
  <div class='search'>
    <f-drawer ref='invoiceDrawer' title='开票明细' width='87%' :show-footer='false' @visibleChange='visibleChange'>
      <fapiao-details ref='form1' :invoiceData='invoiceData'  v-if='drawerVisible'></fapiao-details>
    </f-drawer>
  </div>
</template>
<script>

import FapiaoDetails from "./fapiao_details"

export default {
  name: "FapiaoDetailsDrawer",
  props: {
    invoiceData: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      refs: this.$refs,
      drawerVisible: false,
      isEdit: false,
      title: "",
      current: "form1",
      formData: {},
      columns: null,
      forms: [
        "form1"
      ]
    }
  },
  methods: {
    showDrawer(data) {
      this.formData = data
      this.refs["invoiceDrawer"].show(data)
      this.$nextTick(() => {
        this.refs["form1"].setData(this.formData)
      })
    },
    handleSubmit(callback) {
      this.refs[this.current].handleSubmit(callback)
    },
    visibleChange(drawerVisible) {
      this.drawerVisible = drawerVisible
    },
    tabClick(name) {
      this.current = name
      this.$nextTick(() => {
        this.refs[this.current].setData(this.formData)
      })
    }
  },
  created() {
  },
  components: { FapiaoDetails }
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
